<?php
/**
 * Pert Library
 * Test
 * SessionArray Class
 *
 * @author	Emre Hasegeli <hasegeli@gmail.com>
 * @license	GNU General Public License v3
 */
 
namespace Pert;

require '../SessionArray.php';

require '../Iterator.php';

session_start();

class MyClass
{
	private $name;

	public function __Construct($name)
	{
		$this->name = $name;
	}

	public function __ToString()
	{
		return $this->name;
	}
}

$sessionArray = SessionArray::Select('Test');

if($sessionArray)
{
	foreach($sessionArray AS $element => $value)
		echo '<p >' . $element . ' => ' . $value . '</p>';

	$sessionArray->Delete();
}

$sessionArray = new sessionArray('Test');

$sessionArray[0] = 'Emre';

$sessionArray[1] = new MyClass('Seda');

$sessionArray['Ali Riza'] = 3;

$sessionArray[5] = array('Semra',
		false);

echo '<p >' . count($sessionArray) . '</p>';
